Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var _host = require("./host"), _apiGenerator = _interopRequireDefault(require("./api-generator")), _apiInterceptors = require("./api-interceptors");

function _interopRequireDefault(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

function _objectSpread(t) {
    for (var e = 1; e < arguments.length; e++) {
        var r = null != arguments[e] ? arguments[e] : {}, s = Object.keys(r);
        "function" == typeof Object.getOwnPropertySymbols && (s = s.concat(Object.getOwnPropertySymbols(r).filter(function(e) {
            return Object.getOwnPropertyDescriptor(r, e).enumerable;
        }))), s.forEach(function(e) {
            _defineProperty(t, e, r[e]);
        });
    }
    return t;
}

function _defineProperty(e, t, r) {
    return t in e ? Object.defineProperty(e, t, {
        value: r,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : e[t] = r, e;
}

var commonInterceptors = {
    requestInterceptors: _apiInterceptors.requestAccesstoken,
    responseInterceptors: _apiInterceptors.responseResolveOnlySuccess
}, api = new _apiGenerator.default({
    users: {
        sendcode: [ "POST", {
            alias: "sendCode",
            host: "".concat(_host.apiHost, "/v3"),
            isData: !0,
            requestInterceptors: _apiInterceptors.requestSignature
        } ]
    },
    weapp: {
        wxusermobile: [ "POST", {
            alias: "getUserMobile",
            requestInterceptors: _apiInterceptors.requestAccesstoken
        } ],
        collectformid: [ "POST", {
            requestInterceptors: _apiInterceptors.requestAccesstoken
        } ]
    },
    weappcard: {
        ocrbusinesscard: [ "UPLOAD", {
            requestInterceptors: _apiInterceptors.requestAccesstoken
        }, {
            name: "file"
        } ],
        searchposition: [ "GET", {
            isData: !0,
            requestInterceptors: _apiInterceptors.requestAccesstoken
        } ]
    },
    receipt: {
        searchsuggest: [ "GET", {
            alias: "searchSuggest",
            isData: !0
        } ]
    }
}, _host.apiPrefix), chatApi = new _apiGenerator.default({
    message: {
        unreadcount: [ "GET", {
            alias: "unreads",
            requestInterceptors: _apiInterceptors.requestAccesstoken
        } ],
        setread: [ "POST", commonInterceptors ]
    },
    chat: {
        create: [ "POST", {
            requestInterceptors: _apiInterceptors.requestAccesstoken
        } ],
        lists: [ "GET", _objectSpread({
            alias: "chatlists"
        }, commonInterceptors) ],
        listsv2: [ "GET", _objectSpread({
            alias: "chatlistsv2"
        }, commonInterceptors) ],
        delete: [ "POST", commonInterceptors ]
    },
    setting: {
        setautoreply: [ "POST", commonInterceptors ],
        setchatinfo: [ "POST", commonInterceptors ]
    }
}, _host.apiHost + "/chat"), marketApi = new _apiGenerator.default({
    corp: {
        existmember: [ "GET", commonInterceptors ],
        join: [ "POST", {
            requestInterceptors: [ _apiInterceptors.requestAccesstoken ]
        } ],
        replacemobile: [ "POST", commonInterceptors ]
    }
}, _host.apiHost + "/market"), minicardApi = new _apiGenerator.default({
    common: {
        createeventtracking: [ "POST", {
            requestInterceptors: _apiInterceptors.requestAccesstokenIfExist
        } ]
    }
}, _host.apiHost + "/minicard");

api.chat = chatApi, api.market = marketApi, api.minicard = minicardApi;

var _default = api;

exports.default = _default;